package com.vincent.template.domain;

import com.vincent.template.commons.base.BaseIdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 绑定 角色-权限
 * @Author Vincent Wang
 * @Date 2020/10/21 14:34
 */
@Entity
@Table(name = "sys_bind_role_auth",
        indexes = {@Index(name = "idx_authId", columnList = "authId")},
        uniqueConstraints = {@UniqueConstraint(name = "UK_roleId_authId", columnNames = {"roleId","authId"})})
public class SysBindRoleAuthPo extends BaseIdEntity {

    /**
     * 角色ID
     */
    @Column(nullable = false)
    private Long roleId;
    /**
     * 权限ID
     */
    @Column(nullable = false)
    private Long authId;

    public SysBindRoleAuthPo() {
    }

    public SysBindRoleAuthPo(Long roleId, Long authId) {
        this.roleId = roleId;
        this.authId = authId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getAuthId() {
        return authId;
    }

    public void setAuthId(Long authId) {
        this.authId = authId;
    }
}
